/*
 * Copyright (c) 2018-2999 湖南洛云网络科技有限公司 All rights reserved.
 *
 * https://www.gz-yami.com/
 *
 */

package com.yami.shop.service;


import cn.hutool.core.date.DateTime;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yami.shop.bean.dto.FlowAnalysisDto;
import com.yami.shop.bean.dto.PageAnalysisDto;
import com.yami.shop.bean.dto.SystemDto;
import com.yami.shop.bean.model.FlowLog;
import com.yami.shop.bean.model.FlowUserAnalysis;
import com.yami.shop.bean.model.Order;
import com.yami.shop.bean.param.CustomerRetainRespParam;
import com.yami.shop.bean.param.CustomerRetainedReqParam;
import com.yami.shop.bean.param.FlowAnalysisParam;
import com.yami.shop.bean.param.FlowUserAnalysisParam;
import com.yami.shop.common.util.PageParam;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 *
 *
 * @author YXF
 * @date 2020-07-17 09:50:13
 */
public interface FlowUserAnalysisService extends IService<FlowUserAnalysis> {

    /**
     * 统计用户数据
     * @param flowAnalysisLogMap
     * @param startTime
     * @param flowUserAnalysisMap
     */
    void statisticalUserData(Map<String, List<FlowLog>> flowAnalysisLogMap, Date startTime, Map<String, FlowUserAnalysis> flowUserAnalysisMap);

    /**
     * 统计用户下单/支付金额
     * @param flowLog
     * @param order
     * @param flowUserAnalysisMap
     */
    void statisticalPlaceOrderOrPayData(FlowLog flowLog, Order order, Map<String, FlowUserAnalysis> flowUserAnalysisMap);

    /**
     * 获取用户分析数据
     * @param flowUserAnalysisParam
     */
    void getUserAnalysisData(FlowUserAnalysisParam flowUserAnalysisParam);

    /**
     * 获取流量分析数据
     * @param flowAnalysisParam
     * @return
     */
    FlowAnalysisDto getFlowAnalysisData(FlowAnalysisParam flowAnalysisParam);

    /**
     * 获取流量趋势列表
     * @param flowAnalysisParam
     * @return
     */
    List<FlowAnalysisDto> flowTrend(FlowAnalysisParam flowAnalysisParam);

    /**
     * 流量来源构成
     * @param flowAnalysisParam
     * @return
     */
    List<FlowAnalysisDto> flowSour(FlowAnalysisParam flowAnalysisParam);

    /**
     * 根据商品分析概况参数获取不同系统类型流量分析用户浏览数据记录数量
     * @param flowAnalysisParam
     * @return
     */
    SystemDto systemTypeNums(FlowAnalysisParam flowAnalysisParam);

    /**
     * 获取用户留存率, 统计用户第一次访问后，之后的几个月的留存用户数
     * @param param 条件查询参数
     * @return 访问留存信息列表
     */
    List<CustomerRetainRespParam> getVisitRetained(CustomerRetainedReqParam param);

    /**
     * 清除用户访问留存数据缓存
     * @param param
     */
    void removeCacheVisitRetained(CustomerRetainedReqParam param);
}
